package com.depth.viewer.utils.json
{
	public class JSONParser
	{
		public function JSONParser()
		{
		}
		
		private static var decoder:JSONDecoder=null;
	    private static var encoder:JSONEncoder=null;
	
	    public static function decode(str:Object):* {
		   if(str == null||str.length==0){return null;}
	       if (decoder==null)decoder=new JSONDecoder();
	       return decoder.decode(str as String);
	    }
	
	    public static function encode(obj:*):String {
	      if (encoder==null)encoder=new JSONEncoder();
	      return encoder.encode(obj);
	    }

	}
}